﻿namespace CardGameCore.Battle
{
    public class BattleJudge : IBattleJudge
    {
        private readonly IBattlefield _battlefield;
        private readonly JudgeResult _judgeResult = new JudgeResult();
        public BattleJudge(IBattlefield battlefield)
        {
            _battlefield = battlefield;
        }

        public JudgeResult Process()
        {
            if (_battlefield.Enemy.Hp == 0)
            {
                _judgeResult.Win = true;
            }
            else if (_battlefield.Player.Hp == 0)
            {
                _judgeResult.Fail = true;
            }

            return _judgeResult;
        }
    }
}